package coderead.plugin.bean;

import java.util.Date;
import java.util.List;

public class ArtifactClass implements java.io.Serializable {
    private String version;
    private String artifactId;
    private String groupId;
    private String classname;
    // 组件描述
    private String describe;
    private Date versionModify;

    private transient List<SimpleArtifactInfo> versions;


    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getClassname() {
        return classname;
    }

    public void setClassname(String classname) {
        this.classname = classname;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Date getVersionModify() {
        return versionModify;
    }

    public void setVersionModify(Date versionModify) {
        this.versionModify = versionModify;
    }

    public List<SimpleArtifactInfo> getVersions() {
        return versions;
    }

    public void setVersions(List<SimpleArtifactInfo> versions) {
        this.versions = versions;
    }

    public String getPackage() {
        int i = classname.lastIndexOf(".");
        if (i == -1) {
            return "";
        }
        return classname.substring(0, i);
    }

    public String getSimpleClassName() {
        int i = classname.lastIndexOf(".");
        if (i == -1) {
            return classname;
        }
        return classname.substring(i + 1);
    }
}
